import random
seed,n = input().split()
n = int(n)
seed = int(seed)
random.seed(seed)
martix = []
for i in range(n):
    newline = [random.randint(0,100) for i in range(n)]
    martix.append(newline)
for line in martix:
    for num in line:
        print(f"{num:<4d}",end = '')
    print('')
martix_min = []
for i in range(n):
    m = martix[0][i]
    for j in range(n):
        if martix[j][i] < m:
            m = martix[j][i]
    martix_min.append(m)
flag = 1
for i in range(n):
    m = max(martix[i])
    for j in range(n):
        if martix[i][j] == m and martix[i][j] == martix_min[j]:
            print(f"[{i},{j}] = {martix[i][j]}")
            flag = 0
if flag:
    print("Not Exist.")